{include file="public/header"/}
<style>

.system-parameter-wrapper{
    background-color: white;
    overflow: auto;
    padding: 0px !important;
    padding-bottom: -11px;
    position: absolute;
    top: 11px;
    left: 11px;
    right: 11px;
    bottom: 11px;
}

.para-wrapper{font-size:14px; }
.para-wrapper .para-item h3{font-size:14px;font-weight:bold;margin-bottom:10px;}

.mod-form-rows .label-wrap { width:260px; }
#content3 .mod-form-rows .label-wrap { width:100px; }
#content3 .mod-form-rows td{
  border:1px solid #DDD;
  padding: 5px 10px;
}

.base { width:160px !important; }
.para-item .ui-input{width:220px;font-size:14px;}

.subject-para .ui-input{width:40px;}

.code-length .ui-spinbox-wrap{margin-right:0;}

.books-para input{margin-top:-3px;}

#currency{width: 68px;}
.ui-droplist-wrap .list-item {font-size:14px;}

.tablabel {
    font-weight: bold;
    color: #8e8e8e;
    font-size: 16px;
    display: block;
    padding: 0.5px 30px 10px 30px;
    width: 100px;
}
#three .price-label {
  width: 150px;

}
label:hover {
  cursor: pointer;
}
section {
  display: none;
}
#tab1:checked ~ #content1, #tab2:checked ~ #content2, #tab3:checked ~ #content3 {
  display: block;
}
input:checked + div label {
    color: #48bfea;
    border-bottom: 2px solid #48bfea;
}
.hl{
    width: 90%;
    margin-top: 12px;
    margin-left: 26px;
    height: 2px;
    background-color: #DDD;
}

#one.clicked{
  margin-left: 26px;
  background-position: -25px 0px;
}

#one{
  margin-left: 26px;
  background-position: 0px 0px;
}

#two.normal{
  margin-left: 130px;
  background-position: -50px 0px;
}
#two.clicked{
  margin-left: 130px;
  background-position: -75px 0px;
}

#three.normal{
  margin-left: 150px;
  background-position: -100px 0px;
}
#three.clicked{
  margin-left: 150px;
  background-position: -125px 0px;
}
.operateBtn {
  margin: 0 10px 0 10px;
}
.operateBtn:hover {
  color: #48bfea;
  margin: 0 10px 0 10px;
  border-bottom: 1px solid #48bfea;
  cursor: pointer;
}
.tx-center {
  text-align: center;
}

.backgroundTabs{
    background: url(/css/img/blueandwhite.png) no-repeat;
    background-position: -25px 0px;
    width: 25px;
    height: 22px;
    display: inline-block;
    margin-top: 34px;
}

.mod-form-rows td{
  border:1px solid #DDD;
  padding: 5px 20px;
}

.mod-form-rows{
  border-collapse:collapse;
}

.td1{
  width: 200px;
}

.td2{
    width: 220px;
    text-align: center;
    padding: 5px 10px !important;
}

.td3{
  width: 1000px;
}

#content3 .td1{
  width: 60px;
}

#content3 .td2{
    width: 100px;
    text-align: center;
    padding: 5px 10px !important;
}

#content3 .td3{
  width: 540px;
}

#content1, #content2, #content3{
  margin-top: 22px;
  margin-left: 26px;
}

.tdtitle{
  text-align: center;
}
.table-tips {
  margin-bottom: 20px;
  color: #48bfea;
  font-size: 16px;
}
.system-parameter-wrapper .ui-btn{
    margin-top: 40px;
    margin-left: 26px;
    margin-bottom: 15px;
    background-color: #ff8a00 !important;
    border: 1px solid #ec8000;
}
.chk_blue input {
    display: inline-block;
    position: absolute;
    width: 16px;
    height: 16px;
    cursor: pointer;
    left: 0;
    top: 1px;
    opacity: 0;
}
.chk_blue {
    position: relative;
    font-size: 12px;
    background-position-y: center;
}
.chk_blue label {
  padding-left: 5px;
}
/* new.gif图标 */
.newMenuIcon{display: inline-block;width: 30px;height: 16px;background: url(/css/img/new.gif);}
td.ui_icon {vertical-align: middle;}
.ui_icon img.ui_icon_bg {width: auto;height: auto;}

.forbidden-date-desc {
  color: #999;
  margin-top: -8px;
}

#scmWeb,
#scmApp {
  margin-right: 5px;
}
.price-higher-title {font: bold 20px '微软雅黑';}
</style>
<div class="wrapper system-parameter-wrapper">

      <input id="tab1" type="radio" name="tabs" class="tabs" checked hidden>
      <div id="one" class="clicked backgroundTabs"><label class="tablabel" for="tab1">基础参数</label></div>
      <input id="tab2" type="radio" name="tabs" class="tabs" hidden>
      <div id="two" class="normal backgroundTabs"><label class="tablabel" for="tab2">功能参数</label></div>
      <input id="tab3" type="radio" name="tabs" class="tabs" hidden>
      <div id="three" class="normal backgroundTabs"><label class="tablabel price-label" for="tab3">价格取数优先级<span class="newMenuIcon"></span></label></div>

      <div class="hl"></div>

      <section id="content1">

        <div class="para-item" id="sx">
         
          <ul class="mod-form-rows" id="establish-form">
             {volist name="list" id="vo"}
            <li class="row-item">
              <div class="label-wrap base">
                <label for="companyName">公司名称：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="companyName" class="ui-input" value="{$vo.company_name}" id="companyName" />
                <span id="companyName"></span>
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="companyAddress">公司地址：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="companyAddress" class="ui-input" id="companyAddress" />
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="companyTel">公司电话：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="companyTel" class="ui-input" id="companyTel" />
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="companyFax">公司传真：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="companyFax" class="ui-input" id="companyFax" />
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="postcode">公司邮编：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="postcode" class="ui-input" id="postcode" />
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="startDate">启用时间：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="startDate" value="{:date('Y-m-d',$vo['company_time'])}" class="ui-input ui-input-dis" id="startDate" disabled="disabled" />
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="currency">本位币：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" class="ui-input ui-input-dis" id="currency" value="{$vo.company_base}" disabled="disabled"/>
                <!--<select id="currency-sel" name="currency-sel">
                  <option value="RMB">RMB</option>
                </select>--> 
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label>数量小数位：</label>
              </div>
              <div class="ctn-wrap">
                <input type="number" style="width: 69px;" name="qtyPlaces" value="{$vo.company_quantity}" id="qtyPlaces" class="ui-input" />
                <label style="color: red">小数位由小改大后将不能再改小,请慎重!</label>
              </div>

            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label>单价小数位：</label>
              </div>
              <div class="ctn-wrap">
                <input type="number"  style="width: 69px;" name="pricePlaces" id="pricePlaces" value="{$vo.company_up}" class="ui-input" />
                <label style="color: red">小数位由小改大后将不能再改小,请慎重!</label>
              </div>
            </li>
    
            <li class="row-item">
              <div class="label-wrap base">
                <label for="valMethods">存货计价方法：</label>
              </div>
              <div class="ctn-wrap" id="select">
                <select class="ui-input"name="valMethods" id="valMethods" style="height: 30px;width: 233px;">
                  <option name="valMethods"  value ="1">先进平移算法</option>
                  <option name="valMethods"  value ="2">移动平均算法</option>
                </select>
              </div>
            </li>
            <li class="row-item">
              <div class="label-wrap base">
                <label for="requiredCheckStore">是否检查负库存：</label>
              </div>
              <div class="ctn-wrap">
                <input type="checkbox"  id="requiredCheckStore" checked="true" >
              </div>
            </li>
            {/volist}
          </ul>
          
        </div>
        <!--        <li class="row-item">
              <div class="label-wrap">
                <label>金额小数位：</label>
              </div>
              <div class="ctn-wrap">
                <input type="text" name="amountPlaces" id="amountPlaces" class="ui-input" />
              </div>
            </li>-->
      </section> 

      <section id="content2">
        <div id="para-wrapper" class="para-wrapper">

          <div class="para-item dn">
            <table class="mod-form-rows" id="establish-form2">
              <tr>
                <td class="td1">
                  <div class="label-wrap tdtitle">
                    <label>功能</label>
                  </div>
                </td>
                <td class="td2 tdtitle">
                  <div>
                    <label>操作</label>
                  </div>
                </td>
                <td class="td3 tdtitle">
                  <div>
                    <label>说明</label>
                  </div>
                </td>
              </tr>
            </table>
          </div>
        </div>
      </section> 

      <section id="content3">
        <div id="price-wrapper" class="price-wrapper">
          <div class="para-item dn">
            <div class="table-tips">销货类单据取价</div>
            <table class="mod-form-rows" id="establish-form3">
              
            </table>
          </div>

          <div class="para-item dn" style="margin-top: 80px;">
            <div class="table-tips">购货类单据取价</div>
            <table class="mod-form-rows" id="establish-form4">
              
            </table>
          </div>
        </div>
      </section>

      <div class="btn-wrap"> <input class="ui-btn ui-btn-sp" type="submit" name="" onclick="preservation()"> </div>
        
    </div>
	<script type="text/javascript">


      		function preservation(){
      			var companyName=$("#companyName").val();
      			var companyAddress=$("#companyAddress").val();
      			var companyTel=$("#companyTel").val();
      			var companyFax=$("#companyFax").val();
      			var postcode=$("#postcode").val();
      			var startDate=$("#startDate").val();
      			var currency=$("#currency").val();
      			var qtyPlaces=$("#qtyPlaces").val();
      			var pricePlaces=$("#pricePlaces").val();
      			var valMethods=$("#valMethods").val();
      			var requiredCheckStore=$("#requiredCheckStore");
            
            if (requiredCheckStore.prop('checked')) {
                requiredCheckStore=1;
            }else{
                requiredCheckStore=2;
            }   //判断是否选中 1是查看仓库2是不查看仓库
      			$.ajax({
      				type:"post",
      				url:"index",
      				datatype:"json",
      				data:{
      					companyName:companyName,
      					companyAddress:companyAddress,
      					companyTel:companyTel,
      					companyFax:companyFax,
      					postcode:postcode,
      					startDate:startDate,
      					currency:currency,
      					qtyPlaces:qtyPlaces,
      					pricePlaces:pricePlaces,
      					valMethods:valMethods,
      					requiredCheckStore:requiredCheckStore,
      				},
      				success:function(data){
                //验证返回1
      					if (data.code == 1) {
      						layer.msg(data.msg,{icon:2,time:1000});
      					}
                //保存成功返回2
                if (data.code == 2){ 
                  layer.msg(data.msg,{icon:1,time:1000});
                  history.go(0);
                }
      				},
      				error:function(data){
      					console.log(data.msg);
      				}
      			})
      		}
         

	</script>


	{include file="public/footer"/}